#ifndef _CONFIGURATION_
#define _CONFIGURATION_

#include <iostream>
#include <map>
#include <fstream>
#include <sstream>
#include <string>

using std::cout;
using std::endl;
using std::ifstream;
using std::map;
using std::string;
// 获取配置文件,成员为map<string,string>
class Configuration
{
private:
    //构造函数，接收参数为配置文件相对路径
    Configuration();

    //删除拷贝构造函数和重载等号运算符函数
    Configuration &operator=(Configuration &) = delete;
    Configuration(Configuration &) = delete;

    //单例对象指针
    static Configuration *_pConfInstance;

    //存储conf，例如port 8888
    map<string, string> _confMap;

    //存储配置到成员_confMap
    void storeConfToMap();

public:
    //获得Configuration单例
    static Configuration *getInstance();

    //测试用
    void showMap();

    //得到配置信息
    map<string, string>& getConfMap();
    ~Configuration();
};





#endif